/* PhotoFlow - animated image viewer for mobile devices
 *
 * Copyright (C) 2008 Ariya Hidayat (ariya.hidayat@gmail.com)
 * Copyright (C) 2007 Ariya Hidayat (ariya.hidayat@gmail.com)
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License 
 * as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this library; see the file COPYING.  If not, write to
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301, USA
 *
 */

#include "PhotoFlow.h"

// Qt
#include <qtimer.h>
#include <qwidget.h>

// PhotoFlow
#include "PhotoBrowser.h"

#if defined(PHOTOFLOW_QT3) || defined(PHOTOFLOW_QT2)
#define setWindowTitle setCaption
#endif

class PhotoFlow::Private
{
public:
  PhotoBrowser* display;
};

PhotoFlow::PhotoFlow(QWidget* parent): QWidget(parent)
{
  d = new Private;

  d->display = new PhotoBrowser(this);
  d->display->move(0, 0);
  d->display->setSlideSize(QSize(3*30, 5*30));
#ifdef PHOTOFLOW_QT4
  d->display->setFocusPolicy(Qt::StrongFocus);
#endif
#if defined(PHOTOFLOW_QT3) || defined(PHOTOFLOW_QT2)
  d->display->setFocusPolicy(QWidget::StrongFocus);
#endif

  setWindowTitle(tr("PhotoFlow"));
  setFixedSize(320, 240);
  setFocusProxy(d->display);
}

PhotoFlow::~PhotoFlow()
{
  delete d;
}

QString PhotoFlow::imagePath() const
{
  return d->display->imagePath();
}

void PhotoFlow::setImagePath(const QString& path)
{
  d->display->setImagePath(path);
}

void PhotoFlow::resizeEvent(QResizeEvent* event)
{
  d->display->resize(event->size());
}

void PhotoFlow::keyPressEvent(QKeyEvent* event)
{
}

